
package com.map.domain;

import java.util.Date;

import com.map.util.StringUtil;

public class MapData {
	
	String applicationId;
	String productId;
	String screenId;
	String contentText;
	
	String createdBy;
	Date createdDate;
	String updatedBy;
	Date updatedDate;

	public MapData(String applicationId,
					String productId,
					String screenId,
					String contentText,
					String createdBy,
					Date createdDate,
					String updatedBy,
					Date updatedDate) {

		this.applicationId 	= applicationId;
		this.productId 		= productId;
		this.screenId		= screenId;
		this.contentText	= contentText;
		this.createdBy		= createdBy;
		this.createdDate	= createdDate;
		this.updatedBy		= updatedBy;
		this.updatedDate	= updatedDate;
	}
	
	public String getApplicationId() {
		return applicationId;
	}
	public void setApplicationId(String applicationId) {
		this.applicationId = applicationId;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getScreenId() {
		return screenId;
	}
	public void setScreenId(String screenId) {
		this.screenId = screenId;
	}
	public String getContentText() {
		return contentText;
	}
	public void setContentText(String contentText) {
		this.contentText = contentText;
	}
	public String getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	public Date getCreatedDate() {
		return createdDate;
	}
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	public String getUpdatedBy() {
		return updatedBy;
	}
	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}
	public Date getUpdatedDate() {
		return updatedDate;
	}
	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}
	
	// extra method
	public String[] getContentTextArray() {
		if (!StringUtil.isEmpty(contentText)) {
			String[] dataArray = contentText.split(",");
			int len = dataArray.length;
			// Decrypt 
			for (int i=0; i < len; i++) {
				dataArray[i] = StringUtil.descrypt(dataArray[i]); 
			}
			
			return dataArray;
		}
		return null;
	}
	
}
